home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
cbibcode.arc
/
POW.C
< prev
next >
Wrap
Text File
|
1991-08-05
|
412b
|
23 lines
/* pow.c from page 234*/
#include <stdio.h>
#include <stdlib.h>
#include<math.h>
main(int argc, char **argv)
{
double x, y, result;
if(argc < 3)
{
printf("usage: %s <x> <y>\n", argv[0]);
}
else
{
x = atof(argv[1]);
y = atof(argv[2]);
result = pow(x, y);
if(errno != ERANGE)
{
printf("%s raised to the power of %s = %f\n",
argv[1], argv[2], result);
}
}
}